package com.lean.android.ad.duration.database.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.lean.android.ad.duration.database.entities.AppDurationEntity
import kotlinx.coroutines.flow.Flow

@Dao
internal interface AppDurationDao {
    @Query("select SUM(duration) from app_duration")
    fun getTotalAppDuration(): Flow<Long>

    @Query("delete from app_duration")
    suspend fun deleteAll()

    @Insert
    suspend fun insert(entity: AppDurationEntity)

}